﻿using System.Collections.Generic;
using ShopB2C.Entity;

namespace ShopB2C.Interfaces
{
    public interface IShopCar
    {
        /// <summary>
        /// 增加到购物车
        /// </summary>
        /// <returns>受影响的行</returns>
        int AddToCar(ShopCarEntity car);
        /// <summary>
        /// 更新购物车
        /// </summary>
        /// <param name="count">商品数量</param>
        /// <param name="productId">商品ID</param>
        /// <param name="uid">用户ID</param>
        /// <returns>受影响的行</returns>
        int UpdateCar(int productId , int count , string property , int uid , int type);
        /// <summary>
        /// 删除购物车
        /// </summary>
        /// <returns>受影响的行</returns>
        int DeleteCar(int productId , string property , int uid , int type);
        /// <summary>
        /// 购物车列表
        /// </summary>
        /// <returns>购物车列表</returns>
        List<ProductEntity> CarList(int uid , int type);
        /// <summary>
        /// 存放于cookie中带有自定义属性的产品
        /// </summary>
        /// <param name="productId">关联的产品ID</param>
        /// <param name="Property">自定属性</param>
        /// <returns>带有自定义属性信息的产品</returns>
        ProductEntity CarList(int productId , string Property , int type);
        /// <summary>
        /// 移动购物车项目到指定的类型
        /// </summary>
        /// <param name="shopCarEntity">购物车数据</param>
        /// <param name="cartType">指定的新类型</param>
        /// <returns>受影响的行</returns>
        int MoveToType(ShopCarEntity shopCarEntity , int cartType);
    }
}
